package com.enroll.common;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.enroll.model.Faculty;
import com.enroll.sevice.FacultyService;

public class App {

	public static void main(String[] args) {
		ApplicationContext appContext = new ClassPathXmlApplicationContext(
				"spring/config/BeanLocations.xml");

		FacultyService facultyService = (FacultyService) appContext
				.getBean("facultyService");

		/** insert **/

		/*
		 * Faculty faculty = new Faculty(); faculty.setName("Engineering");
		 */

		/** find by id **/

		Faculty faculty = facultyService.findById(1);
		System.out.println("id: " + faculty.getId());
		System.out.println("name: " + faculty.getName());

		System.out.println("-----Done---------");
	}

}
